package com.bestcem.xm.ticket.service.manager.notification;

import com.bestcem.xm.ticket.enums.NotificationTypeEnum;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.Map;

/**
 * 通知提醒微信公众号模板消息 小标题
 *
 * @author XiaoYunSong <ys.xiao@idiaoyan.com>
 * @version 通知提醒新增微信公众号
 * @date 2022/4/11 15:53
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class TitleTemplate {

    /**
     * 第一份成功完成答卷
     */
    private static final String FIRST_RSPD = "收到成功完成的答卷";
    /**
     * 每次收到成功完成的答卷
     */
    private static final String EVERY_RSPD = "收到成功完成的答卷";
    /**
     * 成功完成答卷数达**份
     */
    private static final String REACH_RSPD = "回收数量提醒";
    /**
     * 指定范围内成功完成答卷数达**份
     */
    private static final String FREQ_RSPD = "回收频次提醒";
    /**
     * 指定范围内成功完成答卷数环比增长**
     */
    private static final String RATIO_RSPD = "回收环比提醒";
    /**
     * 配额满提醒
     */
    private static final String QUOTE_FULL = "问卷配额已满";
    /**
     * 微信红包全部发完
     */
    private static final String BONUS_AWARD = "微信红包全部发完";
    /**
     * 抽奖奖励全部发完
     */
    private static final String DRAW_AWARD = "抽奖奖励全部发完";

    private static final Map<NotificationTypeEnum, String> TITLE_MAP = new HashMap<>();

    static {
        TITLE_MAP.put(NotificationTypeEnum.FIRST_RSPD, FIRST_RSPD);
        TITLE_MAP.put(NotificationTypeEnum.EVERY_RSPD, EVERY_RSPD);
        TITLE_MAP.put(NotificationTypeEnum.REACH_RSPD, REACH_RSPD);
        TITLE_MAP.put(NotificationTypeEnum.FREQ_RSPD, FREQ_RSPD);
        TITLE_MAP.put(NotificationTypeEnum.RATIO_RSPD, RATIO_RSPD);
        TITLE_MAP.put(NotificationTypeEnum.QUOTE_FULL, QUOTE_FULL);
        TITLE_MAP.put(NotificationTypeEnum.BONUS_AWARD, BONUS_AWARD);
        TITLE_MAP.put(NotificationTypeEnum.DRAW_AWARD, DRAW_AWARD);
    }

    /**
     * 获取 通知提醒微信公众号模板消息 小标题
     *
     * @param type 通知类型
     * @return 模板小标题
     * @author XiaoYunSong <ys.xiao@idiaoyan.com>
     * @date 2022/4/11 15:56
     */
    @Nullable
    public static String getTitle(NotificationTypeEnum type) {
        return TITLE_MAP.get(type);
    }
}
